#ifndef Matriz_h
#define Matriz_h

#include <iostream>

using namespace std;

#include "VectorMath.h"

template<class T>
class Matriz{

    private:
        VectorMath<T> *datos;
        unsigned filas;
        unsigned columnas;

    public:
        Matriz(unsigned f = 1, unsigned c = 1);
        Matriz(const Matriz<T> &);
        ~Matriz();

        unsigned getFilas();
        unsigned getColumnas();
        
        VectorMath<T> & operator [](unsigned i);

        Matriz<T> & operator =  (const Matriz<T> &);
        Matriz<T>   operator +  (const Matriz<T> &) const;
        Matriz<T>   operator -  (const Matriz<T> &) const;
        Matriz<T>   operator *  (const Matriz<T> &) const;
        VectorMath<T>   operator *  (const VectorMath<T> &) const;
        bool        operator == (const Matriz<T> &) const;

        T determinante ();
        Matriz<T> adjunta();
        Matriz<T> inversa();
        Matriz<T> escalonada();
        
        string toString();
        static bool test();
        
        friend ostream & operator << (ostream &sal, Matriz<T> &m){
               for(unsigned i = 0; i < m.filas; i++){
                   for(unsigned j = 0;j < m.columnas; j++)
                       sal << m.datos[i][j] << " ";
                   sal << endl;
               }
               return sal;
        }

};

template class Matriz <float>;
template class Matriz <double>;
template class Matriz <long double>;

#endif
